package cn.iocoder.yudao.module.pay.order.vo;

import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.api.pay.order.eums.UnifiedOrderStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 失误，返回信息冗余，后续再改回 {@link PayOrderPrepayRespVO}
 */
@Schema(description = "付款单据提交 Response VO")
@Data
public class PayOrderSubmitRespVO {

    @Schema(description = "支付状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
    @InEnum(UnifiedOrderStatusEnum.class)
    private Integer status;

    @Schema(description = "预支付信息，可用来拉起第三方支付工具", requiredMode = Schema.RequiredMode.REQUIRED, example = """
            {
                "displayContent": "{\\"appId\\":\\"wx2d697917a11930df\\",\\"timeStamp\\":\\"1737604307\\",\\"nonceStr\\":\\"LENaRvp0CgOgK9HNW7NTzqcCZ33V4Kck\\",\\"package\\":\\"prepay_id=wx23115147849912402b20bd357c6b170000\\",\\"signType\\":\\"RSA\\",\\"paySign\\":\\"FT/Lf7tH/kmXpCGCPxO8pGndjLNGW7MGHAuQdzBYnPWUYN9fv9mYzuzdqLWgLrLeuSYmXhXHA4DucuBWt+6C5MLK4Zt0xGlOP1ZT+9Oqe4M6fALAikEMtzKj/RjGnvnaGF1A93gWVQU/IqSXoMvWAF5rc8+7HciNt84DCyUXPojBLPMcjsD+UPNQhBtYaUgkS5mTZGwMTvvtcCzCISw7RDiUuY2PYbeG2kt1WeySAHJDJ4K3mNivhiTLHnClvcacswefl4Ci8XWdaU4hfKGGphGc54t3XWaDEQ3f7q1DDJOlPcXlxTtgtksDZj6VEnQOLJNxVJV38a6sf+HJongEdw==\\"}",
                "displayMode": "app"
            }
            """)
    private PayOrderPrepayRespVO data;

    @Schema(description = "付款单据编号", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long id;

    @Schema(description = "支付单号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String no;

    @Schema(description = "商户交易单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SHP2024111116038888")
    @NotNull(message = "商户交易单号不能为空")
    private String tradeNo;

    @Schema(description = "产品标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "土豆")
    @NotNull(message = "产品标题不能为空")
    private String subject;

    @Schema(description = "产品描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "我是土豆")
    @NotNull(message = "产品描述不能为空")
    private String body;

    @Schema(description = "支付金额，单位：分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
    @NotNull(message = "支付金额，单位：分不能为空")
    private Long price;

    @Schema(description = "支付渠道：alipay_app、wx_lite、wallet", requiredMode = Schema.RequiredMode.REQUIRED, example = "wallet")
    @NotEmpty(message = "支付渠道不能为空")
    private String channelCode;

    @Schema(description = "用户 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1")
    private String userIp;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

}
